package com.web_bloks.types.client;

/**
 * 
 * @author Jean-Lou Dupont
 *
 */
public class IPropertyException extends Exception {

	/**
	 * Exception codes
	 */
	public enum Code {
		
		NOT_PRESENT { String info() {return "NOT_PRESENT";} },
		READ_ONLY	{ String info() {return "READ_ONLY";} },
		PERSISTENT	{ String info() {return "PERSISTENT";} },
		NO_ENUM		{ String info() {return "NO_ENUM";} },
		LOCKED		{ String info() {return "LOCKED";} },
		
		// IPropertyContainer
		KEY_NULL 		{ String info() {return "KEY_NULL";			} },
		TYPE_MISMATCH	{ String info() {return "TYPE_MISMATCH";	} };
		
		abstract String info();
	}

	/**
	 * default
	 */
	static final long serialVersionUID = 0L;

	IPropertyException.Code code = null;
	
	public IPropertyException(String key, IPropertyException.Code code) {
		super( "Key["+key+"] Exception[" + code.info() + "]" );
		this.code = code;
	}
	
}//END